package com.alks.function.mapper.pcfactorywork;

import com.alks.entity.data.entity.PcLotPriceOther;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 预算明细 Mapper 接口
 * </p>
 *
 * @author ms
 * @since 2023-07-21
 */
public interface PcLotPriceOtherMapper extends BaseMapper<PcLotPriceOther> {

    List<PcLotPriceOther> listPcDhPrice(String lotNo);

    /**
     * 修改外接项目单价
     * @param lotNo
     * @param price
     * @param userName
     * @param sysDate
     * @param slipDate
     */
    @Update({
            "update PC_LOT_PRICE_OTHER set PRICE=#{price},SYS_USER=#{userName},SYS_DATE=#{sysDate}, SLIP_DATE=#{slipDate}",
            "where LOT_NO=#{lotNo} and PROCESS='外接单价'",
    })
    void updatePcLotPriceOtherPrice(@Param("lotNo") String lotNo,
                                    @Param("price")BigDecimal price,
                                    @Param("userName")String userName,
                                    @Param("sysDate")LocalDateTime sysDate,
                                    @Param("slipDate")LocalDateTime slipDate);
}
